package com.financing.wap.dao.impl;


import java.sql.SQLException;
import java.util.List;

import org.springframework.stereotype.Repository;

import com.financing.wap.common.SqlName;
import com.financing.wap.dao.IFpShopUserRelProductDao;
import com.financing.wap.dto.FpShopUserRelProductDTO;
/**
 * fp_shop_user_rel_product  
 * 理财师工具用户自有产品表 数据访问层实现类
 * @author huqiyun
 *
 */
 
@Repository("fpShopUserRelProductDao")
public class FpShopUserRelProductDaoImpl extends BaseDaoImpl<FpShopUserRelProductDTO, java.lang.Integer> implements IFpShopUserRelProductDao {


	@Override
	public int insert(FpShopUserRelProductDTO fpShopUserRelProduct) throws SQLException {
		return (Integer) this.sqlMapClientTemplate.insert(SqlName.FpShopUserRelProductSql.insert, fpShopUserRelProduct);
	}

	@Override
	public void update(FpShopUserRelProductDTO fpShopUserRelProduct) throws SQLException {
		this.sqlMapClientTemplate.update(SqlName.FpShopUserRelProductSql.update, fpShopUserRelProduct);
	}

	@Override
	public void updateForce(FpShopUserRelProductDTO fpShopUserRelProduct) throws SQLException {
		this.sqlMapClientTemplate.update(SqlName.FpShopUserRelProductSql.updateForce, fpShopUserRelProduct);
	}

	@Override
	public void delete(Integer id) throws SQLException {
		this.sqlMapClientTemplate.delete(SqlName.FpShopUserRelProductSql.delete,id);
	}
	
	@SuppressWarnings("unchecked")	
	@Override
	public List<FpShopUserRelProductDTO> queryList(FpShopUserRelProductDTO fpShopUserRelProduct) throws SQLException {
		return this.sqlMapClientTemplate.queryForList(SqlName.FpShopUserRelProductSql.queryList, fpShopUserRelProduct);
	}

	@Override
	public int queryListCount(FpShopUserRelProductDTO fpShopUserRelProduct) throws SQLException {
		return (Integer) this.sqlMapClientTemplate.queryForObject(SqlName.FpShopUserRelProductSql.queryListCount, fpShopUserRelProduct);
	}

	@Override
	public FpShopUserRelProductDTO loadById(Integer id) throws SQLException {
		return  (FpShopUserRelProductDTO)this.getSqlMapClientTemplate().queryForObject(SqlName.FpShopUserRelProductSql.loadById,id);
	}

	@Override
	public Class<FpShopUserRelProductDTO> getEntityClass() {
		return FpShopUserRelProductDTO.class;
	}
 	
}
